﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VISS.MailImpl;
using NCT.Mail;
using NCT.Framework;

namespace VISS.Web.BackEnd.Modules.User {

    public partial class MailPreviewPage : System.Web.UI.Page {

        protected string MailBody { get; set; }

        protected void Page_Load(object sender, EventArgs e) {

            string title = ConvertUtils.ToString(Request.Form["txtTitle"]);
            string content = ConvertUtils.ToString(Request.Form["txtContent"]);

            content = content.Replace("|lt", "<").Replace("|gt", ">").Replace("\"", "'");
            
            MailImpl.MailImpl impl = new MailImpl.MailImpl();
            MailMsgEnt ent = impl.BuildMessageEnt("{\"SendMailType\":1,\"MailContent\":\"{\\\"UserKey\\\":\\\"mh6UAgg16vbQAxb\\\",\\\"FullName\\\":\\\"ABC\\\",\\\"Email\\\":\\\"someone@email.com\\\",\\\"Subject\\\":\\\"VISS - Thông báo từ VISS\\\",\\\"Title\\\":\\\"" + title + "\\\",\\\"Content\\\":\\\"" + content + "\\\"}\"}");
            MailBody = ent.Body;            
        }
    }
}
